﻿using AvalonDock.Layout;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
using SqLiteEditor.Helper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml;

namespace SqLiteEditor.Templates
{
    /// <summary>
    /// Interaction logic for TQueryWindow.xaml
    /// </summary>
    public partial class TQueryWindow : UserControl
    {
        public TQueryWindow()
        {
            InitializeComponent();
            InitializeSyntaxHighlighting();
        }

        private void InitializeSyntaxHighlighting()
        {
            using (Stream s = TStreamHelper.OpenStream("Sql.xshd"))
            {
                using (XmlTextReader reader = new XmlTextReader(s))
                {
                    QueryEdittor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
                }
            }
        }
    }
}
